home *** CD-ROM | disk | FTP | other *** search
- FILES is a fairly complete directory display utility. It may be used to just
- list names of files or include specific information about them along with their
- names. It is also capable of paging its output according to your requirements.
-
- Syntax: FILES [drive:][path\][filename][.ext]/options]
-
- drive -- optional drive
- If omitted, the default drive is used.
-
- path -- optional path
- If omitted or if it does not begin with a backslash (\), the current
- path is used.
-
- filename -- optional filename
- If omitted, * is used.
-
- ext -- optional file extension
- If omitted, * is used. If the period (.) is entered and no extension
- is supplied, a blank extension is used.
-
- options -- optional options
- If omitted, the program uses pre-configured options as described next.
-
- Options:
-
- This program may be set to run with a preset list of options or they may be
- toggled from the command line. If for example, you enter /A on the command
- line, the A option is toggled. If you enter /A/A it will be reset to its
- original condition. If you preset the A option in the .COM file, entering /A
- turns it off.
-
- /nn -- nn=1-255 set for paging every 1-255 lines
- nn=0 set for no paging of output
- /A -- file's attributes (Arc Dir Vol Sys Hid R-O)
- /B -- bypass directory check for non-ambiguous file specification
- /C -- clear preset options (turn off /A /B /D /N /O /P /R /S /T and /X)
- /D -- file's creation date and time
- /F -- flip /A /D /P /R and /S options to their opposite condition.
- /N -- only "normal" (data) files
- /O -- only "other" (Dir and Vol) files
- /P -- include full path names for files
- /R -- file's rounded size in K bytes
- /S -- file's size in bytes
- /T -- include a total line
- /X -- include a total line and exclude detail lines
-
- The program is distributed with all options off. The same result can be
- achieved with a modified version of the program by typing:
-
- FILES /0/C
-
- Function:
-
- FILES displays file names and whatever other information you want on the
- screen. The DOS ERRORLEVEl flag is set to 1 if no files were found and to 2
- if some other error was found. Otherwise, errorlevel is set to 0.
-
- The /nn option stops the program every nn lines and waits for a response from
- the keyboard. Pressing CTRL-C ends the program.
- Pressing the letter S or s lets you temporarily leave the program to do some
- other operations. You are prompted to enter a command. If you do, that
- command will be executed and FILES will regain control and proceed to the
- next file or group of files to be listed. If you do not enter a command,
- the program will go to COMMAND.COM and you will then be able to enter any
- commands you wish. When you finish, type EXIT and FILES will regain
- control and continue.
- When you are asked to enter a command, FILES makes available the fully
- specified path and file name of the last file displayed. This allows you to
- use DOS's standard line editing facilities to include the file name. The
- most common application would be to: Press Insert, type a command followed
- by a blank, Press F3 to bring down the filename, then press enter. Here is an
- example.
-
- FILES FILES/1
- FILES.ASM
- Enter command for shell operation.
- *FILES C:\MASM\SOURCE\FILES.ASM/F/P
- FILES.ASM 1988-02-18 16:09:30 12K 11264 Arc
- FILES.DOC
- Enter command for shell operation.
- *FILES C:\MASM\SOURCE\FILES.DOC/F/P
- FILES.DOC 1988-02-18 16:28:56 8K 6656 Arc
-
- In the above example, I added another wrinkle! I typed /F/P after pressing
- F3.
-
- As mentioned earlier, pressing ctrl-C causes the program to terminate. If
- you use the /nn option with /T, the program will display a total line before
- it terminates. This total line will include only the files listed up to the
- point you pressed the ctrl-C. I first discovered this as a bug in the program
- and decided to leave it in.
-
- Presetting options:
-
- There are two ways to preset options:
- 1. Modify the .ASM source file and re-assemble.
- 2. Modify the .COM file directly using DEBUG or equivalent.
-
- To modify the .ASM file, change the values of OPFLAG, LINECT, CURLIN, OPFLG2 and
- DIRFLAG.
- OPFLAG defines which of the /P /R /N /O /D /S /A or /F options are in effect.
- Use the XOR operator to separate the values if you use the equates provided for
- that purpose.
-
- For example, if you want to display all information about files except the
- attributes:
-
- OPFLAG DB FOPT XOR AOPT
-
- LINECT defines whether or not paging is used. A value other than 0 enables
- this feature. The program will pause after that many lines have been displayed.
-
- CURLIN defines the number of lines to print on only the first page. Normally,
- this value should match LINECT but it does not need to. You might wish to
- display 24 lines on the first page and 23 thereafter. This would cause the
- program to print a full page for the first one and after that the line which
- had been on the bottom of the screen would be at the top of the next one on a
- 25 line screen.
-
- For example, to set LINECT and CURLIN in this way enter:
-
- LINECT DB 23
- CURLIN DB 24
-
- OPFLG2 defines which of the /T or /X options are in effect.
- Usually, only one is used at a time because they both produce the total line
- at the end of the program. If both are supplied, /X is used. It supresses
- printing of individual lines describing each file. The format of the total line
- is similar to the detail lines. The number of files appears under the file
- names. If the /P option is included, other totals are on the next line.
- If the /R or /S options are supplied, totals for rounded size and size in bytes
- are displayed under the proper column. On disks with allocation block sizes
- less than 1K (1024 bytes) the file sizes are rounded to the next K boundary when
- /R is used. In which case the total will probably be smaller than the sum of
- the sizes in K for the individual files. The total is derived by rounding each
- file's size up to the next group boundary then rounding the final total up to
- the next K boundary.
-
- DIRFLAG is toggled between 0 and 0FFH by the /B option. Without this option,
- a check will be done to determine if the filename you entered is ambiguous --
- were there any asterisks (*) or question marks (?.
- If not, the file is checked to see if it is a directory file. If so, the
- files in that directory will be listed. If any of the conditions are not met,
- (/B option is selected, file name is ambiguous, or file is not a directory)
- just the information associated with that directory entry will be printed.
- A value of 0FFH selects the /B option.
-
- To modify the .COM file, make the changes to locations 103H through 107H.
-
- 0103 OPFLAG
- 0104 LINECT
- 0105 CURLIN
- 0106 OPFLG2
- 0107 DIRFLAG
-
- You must manually calculate the value for OPFLAG using the following table:
-
- Name Value
-
- AOPT 001H
- DOPT 008H
- FOPT 0CbH
- NOPT 010H
- OOPT 020H
- POPT 080H
- ROPT 040H
- SOPT 002H
-
- You must manually calculate the value for OPFLG2 using the following table:
-
- Name Value
-
- TOPT 001H
- XOPT 002H
-
- Each option you select must be exclusive ored with the previous selections.
-
- For example, as before, if you want to print all information about files
- except their attributes, AOPT (01H) XOR FOPT (0CBH) is 0CEH. Store this value
- at location 0103H.
- l information about files
- except their attributes, AOPT (01H) XOR FOPT (0CBH)